<?php
/**
 * Created by PhpStorm.
 * User: white
 * Date: 2020/5/12
 * Time: 23:04
 */

namespace app\common\validate;

use think\Validate;

class Teacher extends Validate
{
    protected $rule = [
        'photo|照片' =>'require|image',
        'tname|名称' => 'require|unique:teacher',
        'sex|性别' =>'require',
        'position|职位' =>'require',
        'major|专业' =>'require',
        'region|地区' =>'require',
        'recome|推荐指数' =>'require|in:1,2,3,4,5',
        'profile|教师简介' =>'require'
    ];

    //验证场景
    protected $scene = [
        'tea' => [
            'photo','tname','sex','position','region','recome','profile'
        ],
        'edit' => [
            'tname','sex','position','region','recome','profile'
        ],
        'teas' => [
            'photo','tname','position','major'
        ],
        'edits' => [
            'tname','position','major'
        ],

    ];
}